package cn.com.wxd.wechat.company.bean.outxmlbuilder;


import java.util.ArrayList;
import java.util.List;

import cn.com.wxd.wechat.company.bean.WxCpXmlOutNewsMessage;
import cn.com.wxd.wechat.company.bean.WxCpXmlOutNewsMessage.Item;

/**
 * 图文消息builder
 * @author
 */
public final class NewsBuilder extends BaseBuilder<NewsBuilder, WxCpXmlOutNewsMessage> {

	protected final List<Item> articles = new ArrayList<Item>();

	public NewsBuilder addArticle(Item item) {
		this.articles.add(item);
		return this;
	}

	public WxCpXmlOutNewsMessage build() {
		WxCpXmlOutNewsMessage m = new WxCpXmlOutNewsMessage();
		for (Item item : articles) {
			m.addArticle(item);
		}
		setCommon(m);
		return m;
	}

}
